
import { LocationQueryValue } from 'vue-router';
import axios from "../request";
interface CreateOrder {
    addressId: number | string;
    cartItemIds: Array<number>;
}
//提交订单
export function createOrder(params: CreateOrder) {
    return axios.post("/saveOrder", params);
}
interface OrderList {
    pageNumber: number;
    status: number | string;
}
export function getOrderList(params: OrderList) {
    return axios.get("/order", { params });
}

export function getOrderDetail(id: string | LocationQueryValue[] | null) {
    return axios.get(`/order/${id}`);
}

export function cancelOrder(id: string) {
    return axios.put(`/order/${id}/cancel`);
}

//支付
// orderNo payType 1 2 
interface OrderParams {
    orderNo: number | string;
    payType: number;
}
export function payOrder(params: OrderParams) {
    return axios.get("/paySuccess", { params });
}
